package com.mvvm.start.common.utils

import androidx.databinding.BindingAdapter
import com.scwang.smart.refresh.layout.SmartRefreshLayout


@BindingAdapter("isRefresh")
fun SmartRefreshLayout.isRefresh(isRefresh: Boolean) {
    if (isRefresh) autoRefresh() else finishRefresh()
}

@BindingAdapter("onRefresh")
fun SmartRefreshLayout.onRefresh(action: () -> Unit) {
    setOnRefreshListener { action() }
}

